Sends a sample image to a decompressor.
pascal OSErr DecompressSequenceBeginS (
ImageSequence *seqID,
ImageDescriptionHandle desc,
Ptr data,
long dataSize,
CGrafPtr port,
GDHandle gdh,
const Rect *srcRect,
MatrixRecordPtr matrix,
short mode,
RgnHandle mask,
CodecFlags flags,
CodecQ accuracy,
DecompressorComponent codec);
Installs a progress procedure for a sequence.
pascal OSErr SetSequenceProgressProc (
ImageSequence seqID,
ICMProgressProcRecord *progressProc);
The GetCSequenceMaxCompressionSize function allows your application to determine the maximum size an image will be after compression for a given compression sequence. You must have already started a compression sequence with CompressSequenceBegin .
pascal OSErr GetCSequenceMaxCompressionSize(
ImageSequence seqID,
PixMapHandle src,
long *size);
Queues a frame for decompression and specifies the time at which decompression will begin.
pascal OSErr DecompressSequenceFrameWhen (
ImageSequence seqID,
Ptr data,
long dataSize,
CodecFlags inFlags,
CodecFlags *outFlags,
ICMCompletionProcRecordPtr asyncCompletionProc,
const ICMFrameTimeRecord *frameTime);
This function, introduced with QuickTime 2.0, accepts the same parameters as the DecompressSequenceFrame function, with the addition of the frameTime and dataSize parameters. The frameTime parameter points to an ICMFrameTime structure, which contains the frame's time information. The ICMFrameTime structure is described in Chapter 4, "Image Compressor Components."
If the current decompressor component does not support scheduled asynchronous decompression, the Image Compression Manager returns an error code of codecCantWhenErr . In this case, the application will need to reissue the request with the frameTime parameter set to nil. If the decompressor cannot service your request at a particular time (for example, if its queue is full), the Image Compression Manager returns an error code of codecCantQueueErr . The best way to determine whether a decompressor component supports this function is to call the function and test the result code. A decompressor's ability to honor the request may change based on screen depth, clipping settings, and so on.
Queues a frame for decompression and specifies the size of the compressed data. New applications should use DecompressSequenceFrameWhen .
pascal OSErr DecompressSequenceFrameS(
ImageSequence seqID,
Ptr data,
long dataSize,
CodecFlags inFlags,
CodecFlags *outFlags,
ICMCompletionProcRecordPtr asyncCompletionProc);
Stops a decompression sequence, aborting processing of any queued frames.
pascal OSErr CDSequenceFlush(ImageSequence seqID);
This function, introduced with QuickTime 2.0, is used to tell a decompressor component to stop processing of any queued scheduled asynchronous decompression. This is useful when several frames have been queued for decompression in the future and the application needs to suspend playback of the sequence.
Sets the timecode value for the frame that is about to be decompressed.
pascal OSErr SetDSequenceTimeCode (
ImageSequence seqID,
void TimeCodeDef *timeCodeFormat,
void TimeCodeTime *timeCodeTime);
QuickTime's video media handler uses this function to set the timecode information for a movie. When a movie that contains timecode information starts playing, the media handler calls this function as it processes the movie's first frame.
Note that the Image Compression Manager passes the timecode information straight through to the image decompressor component. That is, the Image Compression Manager does not make a copy of any of this timecode information. As a result, you must make sure that the data referred to by the timeCodeFormat and timeCodeTime parameters is valid until the next decompression operation completes.
Reports whether two image descriptions are the same.
pascal OSErr CDSequenceEquivalentImageDescription (
ImageSequence seqID,
ImageDescriptionHandle newDesc,
Boolean *equivalent);
The CDSequenceEquivalentImageDescription function allows an application to ask whether two image descriptions are the same. If they are, the decompressor does not have to create a new image decompression sequence to display those images.
The Image Compression Manager can only implement part of this function by itself. There are some fields in the image description that it knows are irrelevant to the decompressor. If the Image Compression Manager determines that there are differences in fields that may be significant to the codec, it calls the function ImageCodecIsImageDescriptionEquivalent (page 248) to ask the codec.
Requests codec-allocated memory.
pascal OSErr CDSequenceNewMemory (
ImageSequence seqID,
Ptr *data,
Size dataSize,
long dataUse,
ICMMemoryDisposedUPP memoryGoneProc,
void *refCon);
Because many newer hardware decompresson boards contain dedicated on-board memory, significant performance gains can be realized if this memory is used to store data before it is decompressed.
The decompressor can, at any time, dispose of all memory it has allocated. When memory is allocated, an ICMMemoryDisposedProc callback function must be provided. The decompressor calls this routine before disposing of the memory.
A callback procedure is required because memory on the hardware decompresson board may be limited. If the decompressor cannot deallocate memory as required, it is possible that an idle decompressor instance may be holding a large amount of memory, denying those resources to the currently active decompressor instance.
The decompressor memory must never be disposed at interrupt time. When the procedure is called, the memory is still available. This allows any pending reads into the block to be canceled before the block is disposed. The decompressor disposing the memory must ensure that it is not disposing a block that it is currently using (that is, the memory that contains the currently decompressing frame).
To dispose of the memory, use the CDSequenceDisposeMemory function.
Disposes of memory allocated by the codec.
pascal OSErr CDSequenceDisposeMemory (
ImageSequence seqID,
Ptr data);
Notifies the Image Compression Manager that the destination port for the given image decompression sequence has been invalidated.
pascal OSErr CDSequenceInvalidate(
ImageSequence seqID,
RgnHandle invalRgn);
| Previous | Chapter Contents | Chapter Top | Next |